-
Notifications
You must be signed in to change notification settings - Fork 171
Clean up native prover #2741
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
querolita
wants to merge
26
commits into
native/napi
Choose a base branch
from
native/cleanup
base: native/napi
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Clean up native prover #2741
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This was referenced Jan 23, 2026
…ome unknowns left
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
CHANGES
nativefolder insidebindingsnapi-ffi.tswith common helpers to improve readability of the conversion layer, and add type safety. Examples areasArrayLike,arrayFromand constructors for classes expected on the rust side.wasmandnapitypes are involved in a file (such asbindings.ts), we reimport the types and alias them prefixing with eitherwasmornapito improve understandingnapi-wrappers.tsas a workaround that redefines the types coming from Napi in a TS-friendly syntax to enable type safety at compile time. That is, this prevents us from usingas anyandunknownin several locations of the conversion code, as opposed to what we had earlier. If there's a cleaner way to achieve this please do share in the comments, I would love to hear.napi-wrappers.tsto centralize where the conversion types are defined to avoid verbosity in the core/proof/verifier-index/oracles files.toNodeBufferrunInTryCatch?syntax more extensively to define or access optional fieldstsBindingsto contain a singlerustConversionandsrselements that get instantiated differently at runtime using the functiongetConversionBundlewasmornapiwhile keeping type safety at compilation time. This one relies on the global variables defined innode_backend.json the mina repo.bindings.tsto facilitate the logic such asgetKimchiBackendRustConversionthat depends on a genericBackendKind. This is used to determine what conversion type must be usedbuildWasmRustConversionandbuildNapiRustConversionfunctions in case we want to further unify the wasm and napi conversion cores in the futurePartially addresses #2710 and #2711
o1js: #2741
mina: MinaProtocol/mina#18354
proof-systems: o1-labs/proof-systems#3447